﻿@{
    ViewData["Title"] = "Home Page";
    Layout = "/Views/Shared/Shared.cshtml";
    var user = ViewBag.User as User;
    var address = ViewBag.Address as List<UserAddress>;
}

@model Order;

<section>
    <div class="view-product">
        <div class="info-center">
            <div class="manage-head">
                <h6 class="padding-left manage-head-con">订单支付</h6>
            </div>
            <div>
                @if (ViewBag.Temp != null)
                {
                    //raw博客 大概是未加工的意思
                    @Html.Raw(ViewBag.Temp)
                    return;
                }
                <form asp-action="index" asp-controller="zhifu" method="post">
                    <div class="card">
                        <div class="card-header">
                            支付
                        </div>
                        <div class="card-body">

                            <div class="mb-3 row">
                                <label for="staticEmail" class="col-sm-2 col-form-label">订单标题</label>
                                <div class="col-sm-10" style="border-bottom:1px solid">
                                    @*<input type="text" class="form-control" name="orderTitle" value="商品订单">*@
                                     <span name="orderTitle">商品订单</span>
                                </div>
                            </div>
                            <div class="mb-3 row">
                                <label for="staticEmail" class="col-sm-2 col-form-label">订单编号</label>
                                <div class="col-sm-10" style="border-bottom:1px solid">
                                    @*<input type="text" class="form-control" name="orderNo" value="@DateTime.Now.Ticks">*@
                                     <span name="orderNo" >@DateTime.Now.Ticks</span>
                                </div>
                            </div>
                             <div class="mb-3 row">
                                <label for="staticEmail" class="col-sm-2 col-form-label">收货人信息</label>
                                <div class="col-sm-10" style="border-bottom:1px solid">
                                    @*<input type="text" class="form-control" name="orderNo" value="@DateTime.Now.Ticks">*@
                                    <span>
                                         @foreach (var item in address.Where(x => x.Id == int.Parse(@Model.ReceivingAddress)))
                                        {
                                            <span>姓名：</span>@item.Name <span>电话：</span> @item.Phone<span>地址：</span> @item.Province @item.City @item.DisTrict @item.DetailedAddress
                                        }
                                    </span>
                                </div>
                            </div>
                            <div class="mb-3 row">
                                <label for="inputPassword" class="col-sm-2 col-form-label">订单金额</label>
                                <div class="col-sm-10" style="border-bottom:1px solid">
                                    <span name="orderMoney" style="color:coral">￥ @Model.TotalMoney</span>
                                    @*<input type="text" class="form-control" name="orderMoney" value="@Model.TotalMoney">*@
                                </div>
                            </div>

                            <input type="hidden" class="form-control" name="Status" value="2">

                        </div>
                        <div class="card-footer">
                            <button type="submit" id="EditForm" class="btn btn-primary">提交订单</button>
                        </div>

                    </div>
                </form>

            </div>
        </div>
    </div>
</section>
